package com.example.controller.pc;

import com.example.common.result.Result;
import com.example.entity.dto.GongZhuangAddDto;
import com.example.entity.dto.GongZhuangUpdateDto;
import com.example.entity.dto.GongZhuangSelectDto;
import com.example.entity.vo.GongZhuangResultVo;
import com.example.service.GongZhuangService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@Api(tags = "工装管理")
@RequestMapping("/api/gongzhuang")
public class GongZhuangController {

    @Autowired
    private GongZhuangService gongZhuangService;

    @ApiOperation("查询")
    @PostMapping("/list")
    public Result<GongZhuangResultVo> attendance(@RequestBody GongZhuangSelectDto dto){
        return Result.ok(gongZhuangService.list(dto));
    }

    @ApiOperation("修改")
    @PostMapping("/update")
    public Result<?> update(@RequestBody GongZhuangUpdateDto dto){
        gongZhuangService.update(dto);
        return Result.ok();
    }

    @ApiOperation("新增")
    @PostMapping("/add")
    public Result<?> add(@RequestBody GongZhuangAddDto dto){
        gongZhuangService.add(dto);
        return Result.ok();
    }
}
